home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 646 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.1 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Fri, 12 Nov 93 12:46:24 +0100
  3. Message-Id: <9311121146.AA05161@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. Subject: gcc -mbaserel
  6.  
  7. Thomas Schulze wrote me that he gets a "relocation out of range for
  8. (static symbol) in _strerror.o". This is a design bug in
  9. -mbaserel. The problem is this line in strerror.c:
  10.  
  11.         return(_sock_errlist[errnum - MINSOCKERR]);
  12.  
  13. It is compiled into (with -m68030):
  14.  
  15.     lea a4@(__sock_errlist-1200:w),a0
  16.     movel a0@(d1:l:4),d0
  17.  
  18. But if __sock_errlist is allocated in the data segment less than 1200
  19. bytes from the beginning, the offset is too big to be represented as a
  20. signed short. Remember, a4 points to 32k bytes from the start of data.
  21.  
  22. A fix for this is to make _sock_errlist[] a const array, so that it is
  23. allocated in the text segment:
  24.  
  25. --- orig/strerror.c    Wed Nov  3 18:45:02 1993
  26. +++ strerror.c    Fri Nov  5 20:35:32 1993
  27. @@ -118,7 +118,7 @@
  28.  
  29.  /* Support for Kay Roemer's socket library */
  30.  
  31. -char *_sock_errlist[] = {
  32. +char *const _sock_errlist[] = {
  33.      "Socket operation on non-socket",        /* 300 */
  34.      "Destination address required",
  35.      "Message too long",
  36.